package com.john.bms.controller.system;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.*;

@Slf4j
@RestController
@RequestMapping("/transaction")
public class TransactionController {

    @CrossOrigin(origins = "http://localhost:9527")
    @RequestMapping("/list")
    public Object info(){
        List<Map<String,Object>> list = new ArrayList<>();
        Map<String,Object> map = new HashMap<>();
        Map<String,Object> map2 = new HashMap<>();
        Map<String,Object> map3 = new HashMap<>();
        map3.put("order_no","939cB84d-65F4-dD8F-b2B8-12BDBE4c5fDf");
        map3.put("timestamp", "180790141625");
        map3.put("username","Jennifer Wilson");
        map3.put("price","11405");
        map3.put("status", "success");
        list.add(map3);
        map2.put("total",20);
        map2.put("items", list);

        map.put("code",20000);
        map.put("data",map2);

        return map;
    }

}
